package connect4client.core;

import game.Player;

import java.util.Date;


/**
 * Invitation
 *
 * Represents an invitation sent from one player to another to start a new game.
 */
public class Invitation {
	
	public Invitation(Player sender, Player destination, String gameName) {
		this.sender = sender;
		this.destination = destination;
		this.gameName = gameName;
		
		this.dateSent = new Date();
	}
	
	
	/**
	 * Returns an unique ID that identifies this invitation.
	 * 
	 * @return An unique ID that identifies this invitation.
	 */
	public int getId() {
		return this.hashCode();
	}
	
	
	/**
	 * Returns the player who made the invitation.
	 * 
	 * @return The player who made the invitation.
	 */
	public Player getSender() {
		return this.sender;
	}
	
	
	/**
	 * Returns the target of the invitation.
	 * 
	 * @return The player who received the invitation.
	 */
	public Player getDestination() {
		return this.destination;
	}
	
	
	/**
	 * Returns the date the invitation was sent.
	 *
	 * @return The date the invitation was sent.
	 */
	public Date getDateSent() {
		return this.dateSent;
	}
	
	
	/**
	 * Returns the name of the game for this invitation.
	 * 
	 * @return The name of the game for this invitation.
	 */
	public String getGameName() {
		return this.gameName;
	}
	
	
	private Player sender, destination;	// Sender and destiny of the invitation
	private Date dateSent;			// The date the invitation was sent 
	private String gameName;		// The name of the game for this invitation
}
